/*###################################################################*
#
# MP (Mitchell Pell) Base - CrossPlatform Base Utilities.
# Copyright (C) 2014  Mitchell Pell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
####################################################################*/
#ifndef GL_NETWORK_DEFINES_H
#define GL_NETWORK_DEFINES_H

//#include "../../../Base/ConsolePrefix.h"
//using mp_base::console::ConsolePrefix;

namespace mpgl_engine{ namespace application{ namespace net {

	/******************************************************************
	*
	* Data Packet Stream Structure
	*==================================
	*
	* General Concept:
	*
	* Packets in any number can be sent by groups over the
	* network to be concatenated to a packet stream.
	*
	*--------------------------
	* Packet Components:
	*
	*	> [SH] = Packet stream header ( 1 byte )
	*
	*	> [Packet] = Packet ( 3 + n bytes ) contains:
	*		> [PS] = Packet Size as unsigned short (2 bytes)
	*		> [PD] = Packet Data (n bytes)
	*
	*	> Total Stream Size =  4 + n bytes
	*
	*--------------------------
	* Packet Stream Structure Example:
	*
	*	> { [SH] [Packet] [Packet] [Packet]... }
	*  same as
	*	> { [SH] [PS][PD] [PS][PD] [PS][PD]... }
	*
	*--------------------------
	* Packet Receiving and Concatenating Example:
	*
	*	> Current Packet Stream: { [Packet A] [Packet B] }
	*
	*	> Received Packet Stream: { [SH] [Packet C] }
	*
	*	> Resulting Packet Stream: { [Packet A] [Packet B] [Packet C] }
	*
	*--------------------------
	* Packet Pulling and Sending Example:
	*
	*	!! Stream Max of 2 Packets = { [Packet 1] [Packet 2] }
	*
	*	> Current Packet Stream: { [Packet A] [Packet B] [Packet C] }
	*
	*	> Pulled and Sent Packet Stream: { [SH] [Packet A] [Packet B] }
	*
	*	> Resulting Packet Stream: { [Packet C] }
	*
	******************************************************************/



	/*! Simple typedef for unsigned integers. */
	typedef unsigned int uint;
	/*! Simple typedef for unsigned shorts. */
	typedef unsigned short ushort;

	/*!----------------------------------------------------------------
	*	@class		NetworkDefines
	*	@brief		This is a static class that contains constant 
	*				variables and typedefs used by the Network code.
	*
	*	@author		Mitchell Pell
	*	@date		01/04/2014
	*	@version	1.0
	*
	*	@revisions	Revision History:
	*
	*					- Version 1.0 01/04/2014
	*						-# Initial Make
	*
	-----------------------------------------------------------------*/
	static class NetworkDefines
	{
	public:
		 
		/*------------------------------------------------------------
		GlConsole Properties
		------------------------------------------------------------*/

		/*! Prefix to attach to console messages. */
		static const char* const	CONSOLE_MSG_PREFIX;
		/*! Prefix to attach to console error messages. */
		static const char* const	CONSOLE_ERR_PREFIX;
		/*! Prefix to attach to console commands. */
		static const char* const	CONSOLE_CMD_PREFIX;

		/*------------------------------------------------------------
		Session Properties
		------------------------------------------------------------*/

		/*! Maximum number of clients a server can handle. */
		static const uint			SERVER_MAX_CLIENTS;
		/*! Default TCP port used. */
		static const uint			TCP_DEF_PORT;
		/*! Max size of data array being sent to/from the socket. */
		static const uint			TCP_DATA_MAX;

		/*------------------------------------------------------------
		Connection and Packet Properties
		------------------------------------------------------------*/

		static const char			TCP_STREAM_HEADER;

	};
}}}

#endif